package com.ymttest.database.mapping.godmember;

import com.ymttest.database.model.godmember.PointsRule;
import com.ymttest.database.model.godmember.PointsRuleExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface PointsRuleMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @SelectProvider(type=PointsRuleSqlProvider.class, method="countByExample")
    int countByExample(PointsRuleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @DeleteProvider(type=PointsRuleSqlProvider.class, method="deleteByExample")
    int deleteByExample(PointsRuleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @Delete({
        "delete from pointsrule",
        "where RuleId = #{ruleId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer ruleId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @Insert({
        "insert into pointsrule (RuleId, ShopId, ",
        "BizType, Threshold, ",
        "Points, CreateTime, ",
        "UpdateTime)",
        "values (#{ruleId,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, ",
        "#{bizType,jdbcType=INTEGER}, #{threshold,jdbcType=DECIMAL}, ",
        "#{points,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP})"
    })
    int insert(PointsRule record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @InsertProvider(type=PointsRuleSqlProvider.class, method="insertSelective")
    int insertSelective(PointsRule record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @SelectProvider(type=PointsRuleSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="RuleId", property="ruleId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="ShopId", property="shopId", jdbcType=JdbcType.INTEGER),
        @Result(column="BizType", property="bizType", jdbcType=JdbcType.INTEGER),
        @Result(column="Threshold", property="threshold", jdbcType=JdbcType.DECIMAL),
        @Result(column="Points", property="points", jdbcType=JdbcType.INTEGER),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<PointsRule> selectByExample(PointsRuleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @Select({
        "select",
        "RuleId, ShopId, BizType, Threshold, Points, CreateTime, UpdateTime",
        "from pointsrule",
        "where RuleId = #{ruleId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="RuleId", property="ruleId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="ShopId", property="shopId", jdbcType=JdbcType.INTEGER),
        @Result(column="BizType", property="bizType", jdbcType=JdbcType.INTEGER),
        @Result(column="Threshold", property="threshold", jdbcType=JdbcType.DECIMAL),
        @Result(column="Points", property="points", jdbcType=JdbcType.INTEGER),
        @Result(column="CreateTime", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UpdateTime", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    PointsRule selectByPrimaryKey(Integer ruleId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @UpdateProvider(type=PointsRuleSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") PointsRule record, @Param("example") PointsRuleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @UpdateProvider(type=PointsRuleSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") PointsRule record, @Param("example") PointsRuleExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @UpdateProvider(type=PointsRuleSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(PointsRule record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table pointsrule
     *
     * @mbggenerated Tue May 19 11:10:41 CST 2020
     */
    @Update({
        "update pointsrule",
        "set ShopId = #{shopId,jdbcType=INTEGER},",
          "BizType = #{bizType,jdbcType=INTEGER},",
          "Threshold = #{threshold,jdbcType=DECIMAL},",
          "Points = #{points,jdbcType=INTEGER},",
          "CreateTime = #{createTime,jdbcType=TIMESTAMP},",
          "UpdateTime = #{updateTime,jdbcType=TIMESTAMP}",
        "where RuleId = #{ruleId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(PointsRule record);
}